<include file="public:header" />
<!--厅店管理-->
<div class="pad_lr_10">
<div class="explain_col pad_10">
    <b>说明： 如果渠道片区不存在时会自动添加。</b>
</div>
<table width="100%" cellspacing="0" class="search_form">
    <tbody>
        <tr>
            <td>
                <div class="explain_col">                                    
                    <div id="J_upload_excel_own" class="btn" style="clear: both;"><span>{:L('upload_excel')}</span></div> 
                    <div class="btn" style=" float:right;"><span><a href="__EXCEL_TEMP__store.xls">营业厅导入模板下载</a></span></div>
					<!--{/*
                    <div class="btn" style=" float:right;"><span><a href="__EXCEL_TEMP__OwnChannels.xls">自有渠道模板下载</a></span></div> 
                    <div class="btn" style=" float:right;"><span><a href="__EXCEL_TEMP__SocialChannels.xls">社会渠道模板下载</a></span></div> 
					*/}-->
                    <div class="btn" style=" float:right;"><span><a data-height="400" data-width="500" data-id="add" data-title="添加厅店" data-uri="{:U('store/add')}" href="javascript:void(0);" class="add fb J_showdialog"><em>添加厅店</em></a></span></div>  
                </div>
            </td>
        </tr>
    </tbody>
</table>
<div class="pad_lr_10">
  <form name="searchform" method="get" >
    <table width="100%" cellspacing="0" class="search_form">
        <tbody>
            <tr>
                <td>
                <div class="explain_col">
                    <input type="hidden" name="g" value="admin" />
                    <input type="hidden" name="m" value="store" />
                    <input type="hidden" name="a" value="index" />
                    <input type="hidden" name="menuid" value="{$menuid}" />
					
                &nbsp;&nbsp;{:L('region_cate_name')}：
                <select class="J_cate_select mr10" data-pid="0" data-uri="{:U('region/ajax_getchilds',array('level'=>3))}" data-selected="{$search.selected_ids}"></select>
                <input type="hidden" name="regionId" id="J_cate_id" value="{$search.cate_id}" />                   
  
				&nbsp;&nbsp;{:L('store_name')} :
				<input type="text" name="name" class="input-text" size="12" value="{$search.name}" />
                <!--{/*
                &nbsp;&nbsp;{:L('store_channel')}:
                <select name="channel">
                <option value="">-{:L('all')}-</option>
                <option value="1" <if condition="$search.channel eq '1'">selected="selected"</if>>{:L('store_channel1')}</option>
                <option value="0" <if condition="$search.channel eq '2'">selected="selected"</if>>{:L('store_channel2')}</option>
                </select>
                */}-->
                <input type="submit" name="search" class="btn" value="搜索" />
					
                </div>
                </td>
            </tr>
        </tbody>
    </table>
    </form>


    <div class="J_tablelist table_list" data-acturi="{:U('store/ajax_edit')}">
        <table width="100%" cellspacing="0">
            <thead>
            <tr>
                <th width="40"><input type="checkbox" name="checkall" class="J_checkall"></th>
                <th width="40">ID</th>
                <th>{:L('store_name')}</th>
                <th>亚信编码</th>
                <!--{/*<th>{:L('store_channel')}</th>*/}-->
                <th>{:L('REGION_CATE_NAME')}</th>
                <!--{/*<th>{:L('isHaveTaste')}</th>*/}-->
                <!--th>{:L('bc_name')}</th-->
                <!--th>{:L('customer_name')}</th-->
      		
                <th width=100>{:L('operations_manage')}</th>
            </tr>
            </thead>
    	    <tbody>
            <volist name="list" id="val" >
            <tr>
                <td align="center"><input type="checkbox" class="J_checkitem" value="{$val.id}"></td>
                <td align="center">{$val.id}</td>
                <td align="center"><span data-tdtype="edit" data-field="name" class="tdedit" data-id="{$val.id}">{$val.name}</span></td>
                <td align="center">{$val.ctms}</td>
                <!--{/*<td align="center">{:L('store_channel'.$val['channel'])}</td>*/}-->
                <td align="center">{$regionList['l'][$val['regionId']]['name']}</td>
               <!--{/*<td align="center"><if condition="$val.isHaveTaste eq 0">{:L('no')}<else/>{:L('yes')}</if></td>*/}-->
                <!--td align="center">{$bcList[$val['bcId']]}</td-->
                <!--td align="center">{$customerList[$val['customerId']]}</td-->
           
                <td align="center">
                    <a href="javascript:;" class="J_showdialog" data-uri="{:U('store/edit', array('id'=>$val['id']))}" data-title="{:L('edit')} - {$val.name}"  data-id="edit" data-width="500" data-height="300">{:L('edit')}</a> | 
                    <a href="javascript:;" class="J_confirmurl" data-uri="{:U('store/delete', array('id'=>$val['id']))}" data-msg="{:sprintf(L('confirm_delete_one'),$val['name'])}">{:L('delete')}</a>
                </td>
            </tr>
            </volist>
    	   </tbody>
        </table>
    </div>
    <div class="btn_wrap_fixed">
		<label class="select_all mr10"><input type="checkbox" name="checkall" class="J_checkall">{:L('select_all')}/{:L('cancel')}</label>
    	<input type="button" class="btn" data-tdtype="batch_action" data-acttype="ajax" data-uri="{:U('store/delete')}" data-name="id" data-msg="{:L('confirm_delete')}" value="{:L('delete')}" />
		<div id="pages">{$page}</div>
    </div>
</div>
<include file="public:footer" />
<script src="__STATIC__/js/fileuploader.js"></script>
<script>
$('.J_cate_select').cate_select({top_option:lang.all});


	//上传excel
    var uploader = new qq.FileUploaderBasic({
    	allowedExtensions: ['xls'],
        button: document.getElementById('J_upload_excel_own'),
        multiple: false,
        action: "{:U('import/importStore')}",
        inputName: 'excel',
        forceMultipart: true, //用$_FILES
        messages: {
        	typeError: lang.upload_type_error,        	
        	minSizeError: lang.upload_minsize_error,
        	emptyError: lang.upload_empty_error,
        	noFilesError: lang.upload_nofile_error,
        	onLeave: lang.upload_onLeave
        },
        showMessage: function(message){
        	$.pinphp.tip({content:message, icon:'error'});
        },
        onSubmit: function(id, fileName){
        	$('#J_upload_excel_own').addClass('btn_disabled').find('span').text(lang.uploading);
        },
        onComplete: function(id, fileName, result){ 
        	$('#J_upload_excel_own').removeClass('btn_disabled').find('span').text(lang.upload_excel);
            if(result.status == '1'){
        		//$('#J_img').val(result.data);
                $.pinphp.tip({content:result.msg, icon:'success'});
        	} else {
        		$.pinphp.tip({content:result.msg, icon:'error'});
        	}
        }
    });
      
    
</script>
</body>
</html>